Spread Windows Forms 9.0 Product Documentation
AddRange(NamedStyle[]) Method
Example 


Array of styles (NamedStyle objects) to add to the collection
Adds an array of NamedStyle objects to the collection.
Syntax
'Declaration
 
Public Overloads Overridable Sub AddRange( _
   ByVal array() As NamedStyle _
) 
'Usage
 
Dim instance As NamedStyleCollection
Dim array() As NamedStyle
 
instance.AddRange(array)
public virtual void AddRange( 
   NamedStyle[] array
)

Parameters

array
Array of styles (NamedStyle objects) to add to the collection
Example
This example adds a range of styles.
FarPoint.Win.Spread.NamedStyle[] ns = {new FarPoint.Win.Spread.NamedStyle("Style1"),
new FarPoint.Win.Spread.NamedStyle("Style2"),
new FarPoint.Win.Spread.NamedStyle("Style3")};

FarPoint.Win.Spread.NamedStyleCollection nsc = new FarPoint.Win.Spread.NamedStyleCollection();

ns[0].Font = new Font("Comic Sans Serif", 12);
ns[0].Name = "StyleHeaders";
ns[0].Parent = "HeaderDefault";

nsc.AddRange(ns);

fpSpread1.NamedStyles = nsc;
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = ns[0];
Dim ns As FarPoint.Win.Spread.NamedStyle() = {New FarPoint.Win.Spread.NamedStyle("Style1"), 
New FarPoint.Win.Spread.NamedStyle("Style2"), 
New FarPoint.Win.Spread.NamedStyle("Style3")}

Dim nsc As New FarPoint.Win.Spread.NamedStyleCollection

ns(0).Font = New Font("Comic Sans Serif", 12)
ns(0).Name = "StyleHeaders"
ns(0).Parent = "HeaderDefault"

nsc.AddRange(ns)

FpSpread1.NamedStyles = nsc
FpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = ns(0)
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

NamedStyleCollection Class
NamedStyleCollection Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.